Add getters corresponding to the is_active and has_toplevel_focus
authorOwen Taylor <otaylor@redhat.com>
Tue, 28 Oct 2003 15:43:43 +0000 (15:43 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Tue, 28 Oct 2003 15:43:43 +0000 (15:43 +0000)
Tue Oct 28 10:34:24 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkwindow.[ch] (gtk_window_is_active,
        gtk_has_toplevel_focus): Add getters corresponding to
        the is_active and has_toplevel_focus properties.
        (#122531)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/gtk/gtk-sections.txt
gtk/gtkwindow.c
gtk/gtkwindow.h

index 120c6cc7bfff59befdc845f17e7c67744293e013..405ec78612ffacc532010c7fbd1e510aec5ce6bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Tue Oct 28 10:34:24 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.[ch] (gtk_window_is_active, 
+       gtk_has_toplevel_focus): Add getters corresponding to
+       the is_active and has_toplevel_focus properties.
+       (#122531)
+
+Tue Oct 28 10:18:55 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_is_active): 
+
 2003-10-28  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtkexpander.c:
index 120c6cc7bfff59befdc845f17e7c67744293e013..405ec78612ffacc532010c7fbd1e510aec5ce6bd 100644 (file)
@@ -1,3 +1,14 @@
+Tue Oct 28 10:34:24 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.[ch] (gtk_window_is_active, 
+       gtk_has_toplevel_focus): Add getters corresponding to
+       the is_active and has_toplevel_focus properties.
+       (#122531)
+
+Tue Oct 28 10:18:55 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_is_active): 
+
 2003-10-28  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtkexpander.c:
index 120c6cc7bfff59befdc845f17e7c67744293e013..405ec78612ffacc532010c7fbd1e510aec5ce6bd 100644 (file)
@@ -1,3 +1,14 @@
+Tue Oct 28 10:34:24 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.[ch] (gtk_window_is_active, 
+       gtk_has_toplevel_focus): Add getters corresponding to
+       the is_active and has_toplevel_focus properties.
+       (#122531)
+
+Tue Oct 28 10:18:55 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_is_active): 
+
 2003-10-28  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtkexpander.c:
index 120c6cc7bfff59befdc845f17e7c67744293e013..405ec78612ffacc532010c7fbd1e510aec5ce6bd 100644 (file)
@@ -1,3 +1,14 @@
+Tue Oct 28 10:34:24 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.[ch] (gtk_window_is_active, 
+       gtk_has_toplevel_focus): Add getters corresponding to
+       the is_active and has_toplevel_focus properties.
+       (#122531)
+
+Tue Oct 28 10:18:55 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_is_active): 
+
 2003-10-28  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtkexpander.c:
index 120c6cc7bfff59befdc845f17e7c67744293e013..405ec78612ffacc532010c7fbd1e510aec5ce6bd 100644 (file)
@@ -1,3 +1,14 @@
+Tue Oct 28 10:34:24 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.[ch] (gtk_window_is_active, 
+       gtk_has_toplevel_focus): Add getters corresponding to
+       the is_active and has_toplevel_focus properties.
+       (#122531)
+
+Tue Oct 28 10:18:55 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_is_active): 
+
 2003-10-28  Mark McLoughlin  <mark@skynet.ie>
 
        * gtk/gtkexpander.c:
index 96b7d83e88e0530204296906da0177a49578e967..cf64afaf3512e9dc4eb76bd43638ee1a0c2ed401 100644 (file)
@@ -4335,6 +4335,8 @@ gtk_window_set_transient_for
 gtk_window_set_destroy_with_parent
 gtk_window_set_screen
 gtk_window_get_screen
+gtk_window_is_active
+gtk_window_has_toplevel_focus
 gtk_window_list_toplevels
 gtk_window_add_mnemonic
 gtk_window_remove_mnemonic
index 36f3bbd8082739b044ec11ecc762ac7acb9b0b53..35f409f51336bd93f9ecddbd48a2586b357f64ef 100644 (file)
@@ -6340,11 +6340,77 @@ gtk_window_check_screen (GtkWindow *window)
 GdkScreen*
 gtk_window_get_screen (GtkWindow *window)
 {
-   g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
+  g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
    
-   return window->screen;
+  return window->screen;
+}
+
+/**
+ * gtk_window_is_active:
+ * @window: a #GtkWindow
+ * 
+ * Returns whether the window is part of the current active toplevel.
+ * (That is, the toplevel window receiving keystrokes.)
+ * The return value is %TRUE if the window is active toplevel
+ * itself, but also if it is, say, a #GtkPlug embedded in the active toplevel.
+ * You might use this function if you wanted to draw a widget
+ * differently in an active window from a widget in an inactive window.
+ * See gtk_window_has_toplevel_focus()
+ * 
+ * Return value: %TRUE if the window part of the current active window.
+ *
+ * Since: 2.4
+ **/
+gboolean
+gtk_window_is_active (GtkWindow *window)
+{
+  g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+  return window->is_active;
 }
 
+/**
+ * gtk_window_has_toplevel_focus:
+ * @window: a #GtkWindow
+ * 
+ * Returns whether the input focus is within this GtkWindow.
+ * For real toplevel windows, this is identical to gtk_window_is_active(),
+ * but for embedded windows, like #GtkPlug, the results will differ.
+ * 
+ * Return value: %TRUE if the the input focus is within this GtkWindow
+ *
+ * Since: 2.4
+ **/
+gboolean
+gtk_window_has_toplevel_focus (GtkWindow *window)
+{
+  g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+  return window->has_toplevel_focus;
+}
+
+/**
+ * gtk_window_get_is_active:
+ * @window: a #GtkWindow
+ * 
+ * Returns whether the window is part of the current active toplevel.
+ * The return value is %TRUE if the window is active toplevel
+ * itself, but also if it is a GtkPlug embedded in the active toplevel.
+ * You might use this function if you wanted to draw a widget
+ * differently in an active window from a widget in an inactive window.
+ * 
+ * Return value: %TRUE if the window is the current active window.
+ *
+ * Since: 2.4
+ **/
+static gboolean
+gtk_window
+_is_active (GtkWIndow *window)
+{
+  g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+  return window->is_active;
+}
 
 static void
 gtk_window_group_class_init (GtkWindowGroupClass *klass)
index c0d984cf2fc619f6c371221ed421dad92b2619b9..544aef2e5f330576e7fbf45535645be4ba31e2fe 100644 (file)
@@ -225,6 +225,11 @@ void          gtk_window_set_screen               (GtkWindow           *window,
                                                GdkScreen           *screen);
 GdkScreen* gtk_window_get_screen              (GtkWindow           *window);
 
+gboolean   gtk_window_is_active                (GtkWindow           *window);
+gboolean   gtk_window_has_toplevel_focus       (GtkWindow           *window);
+
+
+
 /* gtk_window_set_has_frame () must be called before realizing the window_*/
 void       gtk_window_set_has_frame            (GtkWindow *window, 
                                                gboolean   setting);